<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form name="f1">
      name <input type="text" name="uname" id="" />
      <hr />
      age <input type="text" name="age" id="" />
      <hr />
      gender <input type="radio" name="gender" />boy
      <input type="radio" name="gender" />girl
    </form>
    <script>
      // 获取单个form form+表单name
      console.log(document.f1);
      // 获取form元素 form+表单name+元素name
      console.log(document.f1.uname);
      console.log(document.f1.age);
      console.log(document.f1.gender);
    </script>
  </body>
</html>
